package com.toolmanrln.common.base.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

/**
 * @author ToolMan.RLN
 * @since 2020-05-19 10:33
 */
public enum YesNoEnum implements IEnum<String> {

    否("0","否"), 是("1","是");

    private String value;
    private String desc;

    YesNoEnum(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static YesNoEnum fromValue(String value) {
        YesNoEnum[] yesNoEnums = YesNoEnum.values();
        for (YesNoEnum yesNoEnum : yesNoEnums) {
            if (yesNoEnum.getValue().equals(value)) {
                return yesNoEnum;
            }
        }
        return null;
    }
}
